UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'liCYlLpcET3FtG21EdC3luA0mzBHOAGcJ0g4Q/KP+gc='
WHERE
key_id = 'f8606d21b35fa4c993d6653d4dae1f5db1c38cadc1f2a0fb462723c048271119'
AND (
token = 'liCYlLpcET3FtG21EdC3luA0mzBHOAGcJ0g4Q/KP+gc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)