UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jhsgAc1XfggvlumQ28T2zZ/as9D03PPq6Y/iFsNdphs='
WHERE
key_id = '288ca33f344b2354f3d6364a05daac950cdd3bea98a34ddecacb2788dbf4ca61'
AND (
token = 'jhsgAc1XfggvlumQ28T2zZ/as9D03PPq6Y/iFsNdphs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)