UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '65+T52jfyQuoEo5m5rFZ4+Z5oRMIjI/IIhEnIbVkXbs='
WHERE
key_id = 'd7ed30821f605f7bd2521089b2ff19b7c254868d9e5cd12051d75aec35e9f1db'
AND (
token = '65+T52jfyQuoEo5m5rFZ4+Z5oRMIjI/IIhEnIbVkXbs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)