UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rhIJUzFwM5ZTjE/g3UmkRJMW1NoubUZYNrPu3VQTb8w='
WHERE
key_id = 'f7e2a0f9db78ee29fd504ae9c3fcc80e67bbdeeae0d616d03c6b7ac0f3650e10'
AND (
token = 'rhIJUzFwM5ZTjE/g3UmkRJMW1NoubUZYNrPu3VQTb8w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)