UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zhXh8DCq4Tecys1yvBkiedTlZk/3ccBdMTNFET8kBtc=' 
WHERE 
  key_id = '9df542fe3a0b0336cf955ae784c690525d7feef148f5b5972a61af0d8638af0c' 
  AND (
    token = 'zhXh8DCq4Tecys1yvBkiedTlZk/3ccBdMTNFET8kBtc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039