UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qZyhBqWGIGIVHSAn1plEbv49IaZJgbEFrA2hzyYOQGs='
WHERE
key_id = '60e92ad778beb4e5bc79a6e2baea0b3071c468387980eb6f8fab8d1ea3b774c0'
AND (
token = 'qZyhBqWGIGIVHSAn1plEbv49IaZJgbEFrA2hzyYOQGs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)