UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f2Vu3/9qzLovV6RpPnH8G36IIYiMBfZt+FRE4B4IMS4='
WHERE
key_id = '81a7c7a364437958ca7e24d4119515ad210750174383d4b5bc4a998aa3b03998'
AND (
token = 'f2Vu3/9qzLovV6RpPnH8G36IIYiMBfZt+FRE4B4IMS4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)