UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2G3oN7EVKV6X11kFd7Hb/CF4NcpaoihvV0EBgzGDvTI='
WHERE
key_id = '15336e7aa65be6eb7077c959c1aaad145d3f4ee967943ee5142c3a488d25de6f'
AND (
token = '2G3oN7EVKV6X11kFd7Hb/CF4NcpaoihvV0EBgzGDvTI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)