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

Query time 0.00020