UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sRtw7kmxXkagDYE3exBw1T4o0UAVrQ9dUJYS4NPeUCQ='
WHERE
key_id = 'c181d3be33633771d867b56f9d40ff8e6401191f81a9885ef731c2705aec6f66'
AND (
token = 'sRtw7kmxXkagDYE3exBw1T4o0UAVrQ9dUJYS4NPeUCQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)