UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7OLDThktRzhOZA++lKnbwtKf3BsJ7/yaw7x5uhjWkbM='
WHERE
key_id = 'ad6b86a181ab30f2b4d5d8032d384ed7459cad8de0b0ce2c291382eae21b9fa0'
AND (
token = '7OLDThktRzhOZA++lKnbwtKf3BsJ7/yaw7x5uhjWkbM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)