UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iLHtIdq1mCy2Yo2uLtdOMeXz++Cw6Dsr5zPz3g0Xc8A=' 
WHERE 
  key_id = '3e0f90b43cf392aa410794146720fca9c476b1f881dba5d5cba26df189652025' 
  AND (
    token = 'iLHtIdq1mCy2Yo2uLtdOMeXz++Cw6Dsr5zPz3g0Xc8A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039