UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SOmjMkS/wk80wT+z/aoyM8JE0tYmi9tYfV0nUwZUkJQ='
WHERE
key_id = '157e6c95d47fde06d2a42e99b3a8b162bb4744ff24efd3f317ced66f65a71239'
AND (
token = 'SOmjMkS/wk80wT+z/aoyM8JE0tYmi9tYfV0nUwZUkJQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)