UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BBpMDcT1DpRp8kYxt0wlmTkZlfl8V0JUU7BPdZIlfv0='
WHERE
key_id = '804901d975b35d615ab9698903be1b293de32d82ebc55cac1099acd3f04c0b5d'
AND (
token = 'BBpMDcT1DpRp8kYxt0wlmTkZlfl8V0JUU7BPdZIlfv0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)