UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9tjJtYZkxzY9LPYDWkt4G+fKVOHDVRtQI1rAcPZpMlU='
WHERE
key_id = '41ce0425bf2fefe89ccde47ace6fd449b129281da790baf50bd6c2f21afd3fd9'
AND (
token = '9tjJtYZkxzY9LPYDWkt4G+fKVOHDVRtQI1rAcPZpMlU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)