UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b9KXojzmhwVqC+saLTidqHN3RkLfEiWu8ALqdeEo60g=' 
WHERE 
  key_id = '465675ca17f06d10ad3c1e6c71840d114d3633159551f7619961c75cd4fae82f' 
  AND (
    token = 'b9KXojzmhwVqC+saLTidqHN3RkLfEiWu8ALqdeEo60g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032