UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WJatoeK8WJMzmMWFbY8PZcvvCfa+7aez9FO0BaEtL0E='
WHERE
key_id = 'f8633c61fe6561b4be567e517db5530eb49f4f067f817559d2a6e6b85301320b'
AND (
token = 'WJatoeK8WJMzmMWFbY8PZcvvCfa+7aez9FO0BaEtL0E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)