UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jEodrwuDkvsXmLn+Zf4xy98NAnwRkJQhVAsqdymapMo='
WHERE
key_id = 'ee08ffd8e7fc92fa51b67c3d783cd6a9010cc989c61115100e7cbdf349fe91fd'
AND (
token = 'jEodrwuDkvsXmLn+Zf4xy98NAnwRkJQhVAsqdymapMo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)