UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wpWfuArGbespvj/+6CYK6Cma/5Ld/NhkFeAQDM406D4='
WHERE
key_id = 'e670d93c8d010e94da4d15411617aac67d8bd2c4155078ab9358a00369c993fd'
AND (
token = 'wpWfuArGbespvj/+6CYK6Cma/5Ld/NhkFeAQDM406D4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)