UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GebCoK12nxG2Glpb/nRmyxCt3AxMZncuc2WH7o4Ce10=' 
WHERE 
  key_id = '93ebc743599542b4fc5a78938fe12da906a8a6fced51c5019417eab9b473912d' 
  AND (
    token = 'GebCoK12nxG2Glpb/nRmyxCt3AxMZncuc2WH7o4Ce10=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027