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