UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zt7oyQk2RLG1feZq3ScVcHjDdU0fftG+1Mq10nA+bs8='
WHERE
key_id = 'e03c92a80058ca9fbab060e58a01fe999b2fbb33c8d48d94853d5b6fc6e1e1ef'
AND (
token = 'zt7oyQk2RLG1feZq3ScVcHjDdU0fftG+1Mq10nA+bs8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)