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

Query time 0.00041