UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '00QyYjIu5qaO/O8inyh+pxDuY2Bj80OF0Wd/sewPtF4='
WHERE
key_id = '73c668401d8546a3390af73679960ffcbdfd8f4f8b05f2f5199e4b85dd829257'
AND (
token = '00QyYjIu5qaO/O8inyh+pxDuY2Bj80OF0Wd/sewPtF4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)