UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fXCsJ3kJkos2CVdbdTUk4ZsmMOc1VpwPsd+aMe1g6Bg=' 
WHERE 
  key_id = 'a7b6c6517562ad9bb06a9f2fef474c2125a473024cca999ff5cd0bc97d42ffdd' 
  AND (
    token = 'fXCsJ3kJkos2CVdbdTUk4ZsmMOc1VpwPsd+aMe1g6Bg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027