UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M9VerzWicmUXO5cdjYP5CUrul03vAMBOmt3VxtV30gM='
WHERE
key_id = '1f52091b34ec8068b6139e57c36cc3faf7b991cae0cf64f506aef406a7cfb45f'
AND (
token = 'M9VerzWicmUXO5cdjYP5CUrul03vAMBOmt3VxtV30gM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)