UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'imukEa6LQELbwF3GNI8gbkUeI5o3L+EWJFrQt9w95oc='
WHERE
key_id = '7803c252c66beb7119d2f25a7fa09d9b16c87fd5ac0fc0464ea56a8d4e287616'
AND (
token = 'imukEa6LQELbwF3GNI8gbkUeI5o3L+EWJFrQt9w95oc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)