UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Izj80KPAgI8Me4Szzni+RKyF6mcXTku5Jdl9LYRVASg=' 
WHERE 
  key_id = 'de61062e9566c0265e308f5eebf52c18e96491bc0da315423ec114c264bab126' 
  AND (
    token = 'Izj80KPAgI8Me4Szzni+RKyF6mcXTku5Jdl9LYRVASg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039