UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qSopNtfcfO2HcF2Zdhtvy+X0qCc8tTXu+VJ0kyqBYS8='
WHERE
key_id = '5c5e8568e013401e4bed22dbf0e644cbbc1dad9dd9dde314b7d8a0b07f7ad4a2'
AND (
token = 'qSopNtfcfO2HcF2Zdhtvy+X0qCc8tTXu+VJ0kyqBYS8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)