UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iyRfSh9D9R/Kf/GSeCnTLF/PM0pcOqER2RRx0tdb2mg=' 
WHERE 
  key_id = '107745318069d50531cabd4fbfbf9fcf08b84e7d82f460aaac25fccac1c3ecb2' 
  AND (
    token = 'iyRfSh9D9R/Kf/GSeCnTLF/PM0pcOqER2RRx0tdb2mg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00076