UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MYgtePIJ7K/O7iLp01KUXDiCiPijsFih1fhtNpfqBr0='
WHERE
key_id = '81d67ac5e7bcc9d63e719770305f769d14d626c6611d5e6aa82ea7660a3e429f'
AND (
token = 'MYgtePIJ7K/O7iLp01KUXDiCiPijsFih1fhtNpfqBr0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)