UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z+hm7GjSy3PPpaA+3aX33Gx0gn/p0MuVCeDTLDFBN7Y='
WHERE
key_id = '6e3b5576d0abf22ca2947d136f67c1c7b1af289bdc737b74f96b20f2cdcfc785'
AND (
token = 'Z+hm7GjSy3PPpaA+3aX33Gx0gn/p0MuVCeDTLDFBN7Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)