UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6wq7zgAcedZ1csVUG+wYiCKpkS9jtBMBzQKVzWPPimE=' 
WHERE 
  key_id = 'cf070f59337628304f8a878ea8e484b944ed92ba20b01e17d348ddcfa24a5437' 
  AND (
    token = '6wq7zgAcedZ1csVUG+wYiCKpkS9jtBMBzQKVzWPPimE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033